home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Skunkware 5
/
Skunkware 5.iso
/
src
/
X11
/
endo
/
globals.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-05-03
|
4KB
|
91 lines
/*************************************************************************
* *
* Copyright (c) 1992, 1993 Ronald Joe Record *
* *
* All rights reserved. No part of this program or publication may be *
* reproduced, transmitted, transcribed, stored in a retrieval system, *
* or translated into any language or computer language, in any form or *
* by any means, electronic, mechanical, magnetic, optical, chemical, *
* biological, or otherwise, without the prior written permission of: *
* *
* Ronald Joe Record (408) 458-3718 *
* 212 Owen St., Santa Cruz, California 95062 USA *
* *
*************************************************************************/
/************************************************************************
* globals.h: contains all items useful to vuetest *
* *
* Written by Hiram Clawson. The Santa Cruz Operation *
* Ported to X11 by Ronald Joe Record. *
************************************************************************/
#ifndef GLOBALS_H
#ifdef __MAIN__ /* define this in the main program only */
#define EXTERN /* which will cause definitions of variables*/
#else
#define EXTERN extern /* otherwise, they are externs for subroutines*/
#endif
#include "defines.h"
#ifdef _NO_PROTO
EXTERN void rotate ();
EXTERN void vue_init();
EXTERN int plot();
EXTERN void parseopt();
EXTERN void draw_lines();
EXTERN void RotateWindow();
#else
EXTERN void rotate (triple *, triple *, triple *, double *, double *, double *);
EXTERN void vue_init( triple, int, int );
EXTERN int plot( triple, xy_t * );
EXTERN void parseopt( int, char * [] );
EXTERN void draw_lines( int [], xy_t * );
EXTERN void RotateWindow( double *, triple * );
#endif
#define TAN_30_DEGREES 0.577
#define VECTOR_LENGTH(v) (sqrt( (v.x * v.x) + (v.y * v.y) + (v.z * v.z)))
/* the vector from point a to point b is: */
#define VECTORIZE(v,a,b) v.x = b.x - a.x; v.y = b.y - a.y; v.z = b.z - a.z
#define POINTS_NOT_EQUAL(a,b) (a.x != b.x) || (a.y != b.y) || (a.z != b.z)
#define DOT_PRODUCT(a,b) ( (a.x * b.x) + (a.y * b.y) + (a.z * b.z) )
#define UNIT_VECTOR(lambda,v,length) lambda.x = v.x / length;\
lambda.y = v.y / length; lambda.z = v.z / length
#define VECTOR_X_SCALAR(v_out,v,s) v_out.x = v.x * s; v_out.y = v.y * s;\
v_out.z = v.z * s
#define POINT_PLUS_VECTOR(a,b,v) a.x = b.x + v.x; a.y = b.y + v.y;\
a.z = b.z + v.z
EXTERN xy_t screen_max;
EXTERN xy_t screen_center;
EXTERN double _3D_units_per_ypixel;
typedef struct {
triple P1;
triple P2;
} LINE_END_POINTS ;
EXTERN LINE_END_POINTS grid_lines[30];
EXTERN double half_pi;
EXTERN double two_pi;
EXTERN double radians_per_degree;
EXTERN double degrees_per_radian;
EXTERN triple window_center;
EXTERN triple window_top;
EXTERN triple window_upper_right;
EXTERN triple window_right;
EXTERN triple view_point;
EXTERN triple v_center_top;
EXTERN triple v_center_right;
EXTERN triple v_view_center;
EXTERN double length_view_center;
EXTERN double length_center_right;
EXTERN double length_center_top;
EXTERN double field_of_view; /* in radians */
EXTERN double cosine_half_field_of_view;
#define GLOBALS_H /* indicate that I have been included */
#endif